package zhu.yu.OOP_abstract_class.发红包案例;

import java.util.ArrayList;

public class MainRedPacket {
    public static void main(String[] args) {
        Manager manager = new Manager("群主", 100);

        Member member1 = new Member("成员1", 0);
        Member member2 = new Member("成员2", 0);
        Member member3 = new Member("成员3", 0);

        manager.show(); // 我叫群主我有多少钱100
        member1.show(); // 我叫成员1我有多少钱0
        member2.show(); // 我叫成员1我有多少钱0
        member3.show(); // 我叫成员1我有多少钱0
        System.out.println("==========");

        // 群主发20块钱3个包
        ArrayList<Integer> redList = manager.send(20, 3);

        // 三个成员抢红包
        member1.receive(redList);
        member2.receive(redList);
        member3.receive(redList);

        // 打印 name money  随机list有余数的红包不知道会发给谁
        manager.show();  // 我叫群主我有多少钱80
        member1.show();  // 我叫成员1我有多少钱6
        member2.show();  // 我叫成员1我有多少钱6
        member3.show();  // 我叫成员2我有多少钱8
    }
}
